import java.util.Scanner;

public class Liu3 {
   //定义一个方法，根据某年某月某日的日期，判断这一天是这一年的第几天
	public static void main(String[] args) {
		getDay();
	}
	public static int getDay(){
		int year;//年
		int mouth;//月
		int day=0;//每月天数
		int days;//本月过了多少天
		int tian=0;//前几个月总共天数
		int n=0;//条件值
		Scanner scanner=new Scanner(System.in);
		do {
		   System.out.println("输入年");
		   year=scanner.nextInt();
		   System.out.println("输入月");
		   mouth=scanner.nextInt();
		   System.out.println("输入日");
		   days=scanner.nextInt();
		   if (mouth<0 || mouth>12 || days<0 || days>31) {
			  System.out.println("格式错误");
			  n=1;
		     }
		   }while (n==1);
		for (int i = 1; i < mouth; i++) {
				switch (i) {
				case 1:
				case 3:
				case 5:
				case 7:
				case 8:
				case 10:
				case 12:{
					day=31;
					break;
				}
				case 4:
				case 6:
				case 9:
				case 11:{
					day=30;
					break;
				}
				case 2:{
					if ((year%4==0 && year%100!=0 || year%400==0) ) {
						day=29;
					}else {
						day=28;
					}
				}
				default:
					break;
				}
				tian +=day;
			}
			System.out.println("这是"+year+"年的"+(tian+days)+"天");
			return n;
			
	}
}
